import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:get/get.dart';
import 'package:testicon/router/router.dart';
import 'package:testicon/genkey/view.dart';

import 'decrypt/binding.dart';
import 'encrypt/binding.dart';
import 'genkey/binding.dart';
import 'router/binding.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return GetMaterialApp(
      builder: EasyLoading.init(), // 添加此行初始化 EasyLoading
      theme: ThemeData(
        primarySwatch: Colors.blue,
        appBarTheme: const AppBarTheme(
          backgroundColor: Colors.blue, // 蓝底
          titleTextStyle: TextStyle(
            color: Colors.white, // 白字
            fontSize: 20,
            fontWeight: FontWeight.bold,
          ),
        ),
      ),
      home: MainNavigationPage(),
      initialRoute: '/main',
      getPages: [
        GetPage(
          name: '/main',
          page: () => MainNavigationPage(),
          bindings: [ // 使用多绑定
            NavBinding(),
            GenKeyBinding(),
            EncryptBinding(),
            DecryptBinding(),
      ],
        ),
      ],
    );
  }
}
